using System.Collections.Generic;
using opt.Analysis.Branch;
using CLELCore.Collections;
using CLELCore.Assembly.CLELInstructions;

namespace opt.lib.BIR
{
	public class PeepholeBIRMethod : IBIRMethod
	{
		private List<BranchKey> _keys;

		public PeepholeBIRMethod(List<BranchKey> keys)
		{
			_keys = keys;
		}

		public bool Accept(IBIRVisitor visitor)
		{
			int i,keys_count = _keys.Count;
			bool changed = false;
			for(i = 0;i < keys_count;i++)
			{
				if(visitor.Visit(i,_keys[i]))
					changed = true;
			}
			return changed;
		}
	}
}
